<template>
  <div>
    <h1>占位</h1>
    <!-- el-scrollbar滚动条组件 -->
    <el-scrollbar>
      <el-menu
        :default-active="$route.path"
        router
        background-color="#304156"
        text-color="#bfcbd9"
        active-text-color="#ffffff"
      >
        <sidebar-menu v-for="(item) in menu" :key="item.path" :route='item'></sidebar-menu>
      </el-menu>
    </el-scrollbar>
  </div>
</template>

<script>
import SidebarMenu from "./SidebarMenu.vue";
export default {
  components: { SidebarMenu },
  data() {
    return {
      menu: [
        {
          path: "/profile",
          name: "profile",
          meta: {
            title: "个人中心",
            icon: "icon-gerenzhongxin",
          },
        },
        {
          path: "/user",
          redirect: "/user/manage",
          meta: {
            title: "用户",
            icon: "icon-users",
          },
          props: {
            default: false,
          },
          children: [
            {
              path: "/user/manage",
              name: "userManage",
              meta: {
                title: "员工管理",
                icon: "icon-yuangongguanli",
              },
              children: [],
            },
            {
              path: "/user/role",
              name: "userRole",
              meta: {
                title: "角色列表",
                icon: "icon-tongxunlu",
              },
              children: [],
            },
            {
              path: "/user/permission",
              name: "userPermission",
              meta: {
                title: "权限列表",
                icon: "icon-quanxianguanli",
              },
              children: [],
            },
          ],
        },
        {
          path: "/article",
          redirect: "/article/ranking",
          meta: {
            title: "文章",
            icon: "icon-describe",
          },
          props: {
            default: false,
          },
          children: [
            {
              path: "/article/ranking",
              name: "articleRanking",
              meta: {
                title: "文章排名",
                icon: "icon-liebiao",
              },
              children: [],
            },
            {
              path: "/article/create",
              name: "articleCreate",
              meta: {
                title: "创建文章",
                icon: "icon-bianjiwenzhang_huaban",
              },
              children: [],
            },
          ],
        },
      ],
    };
  },
  mounted() {},
  methods: {},
};
</script>

<style scoped lang='scss'>
</style>
